import request from '@/utils/request'

/**
 * 第三方店铺分页查询
 */
export function pageThirdShop(params) {
  return request({
    url: '/user/thirdShop/paging',
    method: 'get',
    params
  })
}

/**
 * 第三方店铺集合
 * @param enterpriseId
 * @param memberId
 * @param platformType
 */
export function listThirdShop(params) {
  return request({
    url: '/user/thirdShop/listThirdShop',
    method: 'get',
    params: params
  })
}

/**
 * 获取更新第三方库存频率
 */
export function getStockFreq() {
  return request({
    url: '/user/thirdShop/getStockFreq',
    method: 'get'
  })
}

/**
 * 保存第三方店铺
 */
export function saveThirdShop(data) {
  return request({
    url: '/user/thirdShop/save',
    method: 'post',
    data
  })
}

/**
 * 删除第三方店铺
 */
export function deleteThirdShop(thirdShopId) {
  return request({
    url: '/user/thirdShop/delete',
    method: 'post',
    params: { thirdShopId }
  })
}

/**
 * 检查店铺开通拼多多消息情况
 * @param shopId
 * @param platformType
 */
export function checkUserPermit(shopId, platformType) {
  return request({
    url: '/user/thirdShop/checkUserPermit',
    method: 'get',
    params: { shopId, platformType }
  })
}

/**
 * 检查店铺开通拼多多消息情况
 * @param shopId
 * @param platformType
 */
export function userPermit(shopId, platformType, shopName) {
  return request({
    url: '/user/thirdShop/userPermit',
    method: 'get',
    params: { shopId, platformType, shopName }
  })
}
